package com.yq.day30;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


/**
 * @author 3307235355@qq.com
 * @description
 * @since 2022/06/30 09:25
 */
public class Demo04 {
    public static void main(String[] args) {
        ExecutorService ex1 = Executors.newFixedThreadPool(2);
        ex1.submit(new MyPool1());
        ex1.submit(new MyPool1());
        ex1.submit(new MyPool1());
        ex1.submit(new MyPool1());

        // ex1.shutdownNow();
        ex1.shutdown();

    }
}
class MyPool1 implements Runnable{

    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println(Thread.currentThread().getName()+"======="+i);
        }
    }
}